﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="true" CodeFile="Product.aspx.cs" Inherits="Admin_Product" %>

<%@ Register src="../Controls/Pager.ascx" tagname="Pager" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    <div class="title">Product</div>
    <div id="filter">
        Name
        <asp:TextBox ID="txtName" runat="server" Height="13px"></asp:TextBox>
    </div>
    <div class="toolbar">
        <input type="button" value="Add new product" onclick="location.href='EditProduct.aspx'" />
        <asp:Button Text="Delete selected" runat="server" ID="btnDelete" CssClass="multidelete" />
    </div>
    <uc1:Pager ID="pagerTop" runat="server" />
    <asp:Repeater runat="server" ID="repProd">
        <HeaderTemplate>
            <table class="list">
                <thead>
                    <tr>
                        <th class="cid">
                            <input type="checkbox" id="chkAll" />
                        </th>
                        <th class="small">
                            Image
                        </th>
                        <th>
                            <asp:LinkButton ID="lnkName" runat="server" CommandName="SortName">Name</asp:LinkButton>
                        </th>
                        <th class="small">
                            <asp:LinkButton ID="lnkPrice" runat="server" CommandName="SortPrice" CommandArgument="0">Price</asp:LinkButton>
                        </th>
                        <th class="small">
                            <asp:LinkButton ID="lnkPromo" runat="server" CommandName="SortPromo" CommandArgument="0">Promo</asp:LinkButton>
                        </th>
                        <th class="id">
                            <asp:LinkButton ID="lnkID" runat="server" CommandName="SortID" CommandArgument="0">ID</asp:LinkButton>
                        </th>
                    </tr>
                </thead>
        </HeaderTemplate>
        <AlternatingItemTemplate>
            <tr class="even">
                <td>
                    <input type="checkbox" name='cid' value='<%#Eval("ProductID") %>' />
                </td>
                <td>
                    <img class="image" src='<%#DataAccess.Link.ToProductImage(Eval("Thumbnail").ToString()) %>'
                        alt='' />
                </td>
                <td class="link">
                    <a href='EditProduct.aspx?cid=<%#Eval("ProductID") %>'>
                        <%#Eval("Name")%>
                    </a>
                </td>
                <td>
                    <%#Eval("Price", "{0:#.##}")%>
                </td>
                <td>
                    <asp:LinkButton ID="LinkButton1" runat="server" Text='<%#Eval("PromoFront")%>' CommandName="UpdatePromo"
                        CommandArgument='<%#Eval("ProductID") + "_" + Eval("PromoFront")%>' />
                </td>
                <td class="id">
                    <%#Eval("ProductID")%>
                </td>
            </tr>
        </AlternatingItemTemplate>
        <ItemTemplate>
            <tr>
                <td>
                    <input type="checkbox" name='cid' value='<%#Eval("ProductID") %>' />
                </td>
                <td>
                    <img class="image" src='<%#DataAccess.Link.ToProductImage(Eval("Thumbnail").ToString()) %>'
                        alt='' />
                </td>
                <td class="link">
                    <a href='EditProduct.aspx?cid=<%#Eval("ProductID") %>'>
                        <%#Eval("Name")%>
                    </a>
                </td>
                <td>
                    <%#Eval("Price", "{0:#.##}")%>
                </td>
                <td>
                    <asp:LinkButton ID="LinkButton2" runat="server" Text='<%#Eval("PromoFront")%>' CommandName="UpdatePromo"
                        CommandArgument='<%#Eval("ProductID") + "_" + Eval("PromoFront")%>' />
                </td>
                <td class="id">
                    <%#Eval("ProductID")%>
                </td>
            </tr>
        </ItemTemplate>
        <FooterTemplate>
            </table>
        </FooterTemplate>
    </asp:Repeater>
    <uc1:Pager ID="pagerBottom" runat="server" />
</asp:Content>

